home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 March
/
EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso
/
earcd
/
library
/
grafpapr.lha
/
GrafPaper.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-02-12
|
6KB
|
198 lines
/*
Short: Prints graph-paper of any size or type
Author: Bill Beogelein (ag775@detroit.freenet.org)
Uploader: Bill Beogelein (ag775@detroit.freenet.org)
Type: util/misc
Filename: GrafPaper.lha
Version: v1.1
Release-Date: Mon 12-Feb-96 18:35:42
Requires: Arexx and WB v2.04 or higher
Replaces: GrafPaper#?.lha (v1.0)
Language: English
Compression: LHA type lh5
CPU: 68000-68060
Newsgroup: comp.sys.amiga.misc
Organization: Amiga ShareWare HeadQuarters BBS 810-473-2020
Keywords: Graph, Paper, Graph-Paper, Print, Grid, Printer
You decide:
Number of boxes across and down.
Width and height of each box.
Left and top margins.
Usage...
> rx GrafPaper.rexx >par: XMARGIN=10 XSIZE=5 XCOUNT=8 YMARGIN=6 YSIZE=4 YCOUNT=12 HEADER=My_Title
The above cmd will:
> Indent 10 spaces for left margin.
> Draw boxes 5 spaces wide.
> Place 8 boxes across the page.
> and...
> Have a top margin of 6 lines.
> Each box will be 4 chars high.
> Place 12 boxes down the page.
Valid ranges for XMARGIN, XSIZE, YMARGIN, and YSIZE: 0-999.
Valid ranges for XCOUNT and YCOUNT: 1-999.
Options (need additional parameters):
> XSIZE=3 Make each box x chars wide.
> XCOUNT=23 Make x boxes across the page.
> XMARGIN=4 Index x spaces for left margin.
> YSIZE=6 Make each box x chars high.
> YCOUNT=12 Make x boxes down the page.
> YMARGIN=2 Skip x lines for top margin.
> HEADER=My_Title_Line Print this at top of page.
> FOOTER=My_Bottom_Line Print this at end of page.
Keywords:
> DOUBLE Make double-lined graph paper. (Default is single-lined.)
> CROSS Make graph paper out of crosses, not boxes.
> HELP Show HELP template.
> NORMAL 10 chars/inch. Good for 1-42 columns.
> SMALL 12 chars/inch. Good for 43-52 columns.
> SMALLER 15 chars/inch. Good for 53-70 columns.
Author Info:
Bill Beogelein
Box 530441
Livonia, MI 48153
BBS 810-473-2020, 28k8, Fido 1:2410/207, ag775@detroit.freenet.org
If you wish to view the IBM graphic characters in the CLI window, issue
a DOS-cmd like "SetFont IBM 8". To restore your CLI to the default font,
issue a DOS-cmd like "SetFont topaz 8".
$VER: rexx:GrafPaper.rexx v1.1 Mon 12-Feb-96 18:35:42
Added HEADER and FOOTER options.
Released into Aminet.
$VER: rexx:GrafPaper.rexx v1.0 Sun 13-Feb-94 21:10:18
Beta testing
rx rexx:GrafPaper.rexx >par: XSIZE=1 XCOUNT=39 YCOUNT=88
Future plans:
Allow spaces in HEADER and FOOTERs.
Number the boxes TOP, RIGHT, BOTTOM, LEFT.
Ignore:
lz u dh3:a/6.8/GrafPaper.lha rexx:GrafPaper.rexx a:zzzBBS
lz -r u dh3:a/6.8/GrafPaper.lha C:SetFont Fonts:IBM Fonts:IBM.font
*/
/****** Top of user-settable variables ******/
cpiCode.1 = "27 80 " /* Your printer's 10-CPI codes */
cpiCode.2 = "27 77 " /* Your printer's 12-CPI codes */
cpiCode.3 = "27 103" /* Your printer's 15-CPI codes */
empCode = "27 69" /* Your printer's emphasized codes */
uniCode = "27 85 1" /* Your printer's uni-direction codes */
/****** End of user-settable variables ******/
parse arg opts
x_margin = GetKeyWrd(opts, "XMARGIN=", 4)
x_size = GetKeyWrd(opts, "XSIZE=" , 1)
x_count = GetKeyWrd(opts, "XCOUNT=" , 37)
y_margin = GetKeyWrd(opts, "YMARGIN=", 0)
y_size = GetKeyWrd(opts, "YSIZE=" , 0)
y_count = GetKeyWrd(opts, "YCOUNT=" , 62)
header = GetKeyWrd(opts, "HEADER=" , ""); header= translate(header, " ", "_")
footer = GetKeyWrd(opts, "FOOTER=" , ""); footer= translate(footer, " ", "_")
o_double = GetSwitch(opts, "DOUBLE" , 0)
o_cross = GetSwitch(opts, "CROSS" , 0)
o_help = GetSwitch(opts, "HELP" , 0)
o_small = GetSwitch(opts, "SMALL" , 0)
o_smaller= GetSwitch(opts, "SMALLER" , 0)
LF = '0a'x
if(y_count="" | o_help) then
do
say LF "Rexx:GrafPaper.rexx by Bill Beogelein 810-473-2020 (1:2410/207)"
say LF "rx GrafPaper.rexx >par: xMARGIN=a xSIZE=b xCOUNT=c yMARGIN=d ySIZE=e yCOUNT=f DOUBLE CROSS SMALL SMALLER HEADER=title FOOTER=title" LF
exit
end
/* "12345678901" */
chars= "Ú¿ÃÅ´ÀÁÙij"
if(o_double) then chars= "ÉË»ÌιÈʼͺ"
if(o_cross) then
do
chars= "Ú¿ÃÅ´ÀÁÙ " /* No vert or horz bars */
if(o_double) then chars= "ÉË»ÌιÈʼ "
end
if(o_small) then /* Set-up printer */
PrintCodes(cpiCode.2)
else if(o_smaller) then
PrintCodes(cpiCode.3)
else
PrintCodes(cpiCode.1)
/* PrintCodes(empCode) xxx */
PrintCodes(uniCode)
h= spc(x_margin) || char(1) /* ÉÍÍÍÍËÍÍÍÍËÍÍÍÍËÍÍÍÍËÍÍÍÍ» */
i= copies(char(10), x_size)
j= copies(i || char(2), x_count-1)
say copies(LF, y_margin) || spc(x_margin) || header || LF || h || j || i || char(3)
h= spc(x_margin) || char(11) /* º º º º º º */
i= spc(x_size) || char(11)
j= spc(x_margin) || char(4) /* ÌÍÍÍÍÎÍÍÍÍÎÍÍÍÍÎÍÍÍÍÎÍÍÍ͹ */
k= copies(char(10), x_size)
l= copies(k || char(5), x_count-1)
m= copies(h || copies(i, x_count) || LF, y_size)
o= j || l || k || char(6)
call writeCH(STDOUT, m || copies(o || LF || m, y_count-1)) /* Repeat the above 2 bars */
h= spc(x_margin) || char(7) /* ÈÍÍÍÍÊÍÍÍÍÊÍÍÍÍÊÍÍÍÍÊÍÍÍͼ */
i= copies(char(10), x_size)
j= copies(i || char(8), x_count-1)
say h || j || i || char(9) LF || spc(x_margin) || footer || copies(LF, 2)
exit /*********** End of main ***********/
Spc: PROCEDURE
parse arg n
return copies(" ", n)
Char:
parse arg which
return substr(chars,which,1)
PrintCodes: PROCEDURE
parse arg buf
do i=1 to words(buf)
call writeCH(STDOUT, d2c(word(buf,i)))
end i
return 1
GetSwitch: PROCEDURE EXPOSE opts
parse arg opts, str, def
w=find(upper(opts), upper(str))
if(w<1) then return def
opts=delword(opts, w, 1)
return ~(def) /*** End of GetSwitch ***/
GetKeyWrd: PROCEDURE EXPOSE opts
parse arg opts, str, def
p=pos(upper(str), upper(opts))
if(p<1) then return def
len=length(str)
s=word(substr(opts, p+len),1)
opts=delstr(opts, p, len+length(s)+1)
return s /*** End of GetKeyWrd ***/
/*** EOF rexx:GrafPaper.rexx 810-473-2020 ***/